var Ajax = require('../common/Ajax');

var Index = function(){
    this.initial();
};

Index.prototype = {
    constructor : Index,
    initial : function(){
        this.bindEvent();
    },
    bindEvent : function(){
        this.setHTMLSize();
        this.windowResize();
        this.initSwiper();
    },
    setHTMLSize : function(){
        var oHtml = document.querySelector('html');
        var width = oHtml.getBoundingClientRect().width;
        oHtml.style.fontSize = width / 15 + 'px';  // 针对设计尺寸为750 , 如果为 640 此处 / 16;
    },
    windowResize : function(){
        var root = this;
        window.addEventListener('resize',function(){
            root.setHTMLSize();
        },false);
    },
    initSwiper : function(){
        var mySwiper = new Swiper('.swiper-container');
    }
};

module.exports = new Index();